package com.yebxxx.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yebxxx.server.mapper.SysMsgContentMapper;
import com.yebxxx.server.pojo.PageBean;
import com.yebxxx.server.pojo.SysMsgContent;
import com.yebxxx.server.service.ISysMsgContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author stx
 * @since 2022-03-23
 */
@Service
public class SysMsgContentServiceImpl extends ServiceImpl<SysMsgContentMapper, SysMsgContent> implements ISysMsgContentService {
    @Autowired
    private  SysMsgContentMapper sysMsgContentMapper;
    /**
     * 查询留言列表
     * @param
     * @param sysMsgContent
     * @return
     */
    @Override
    public PageBean sysMsgContentList(Integer currentPage, Integer size, SysMsgContent sysMsgContent) {
        Page<SysMsgContent> page=new Page<>(currentPage,size);//开启分页
        IPage<SysMsgContent> iPage=sysMsgContentMapper.sysMsgContentList(page,sysMsgContent);//查询列表封装page
        PageBean pageBean=new PageBean(iPage.getTotal(),iPage.getRecords());

        return pageBean;
    }
}
